
#ifndef TLG_H
#define TLG_H

#include <stdint.h>

typedef struct {
	char mark[11];	// "TLG5.0\x0raw\x1a"
	uint8_t colors;		// 3 or 4
	uint32_t width;
	uint32_t height;
	uint32_t blockheight;// 4
} tlg5_header_t;

typedef struct {
	int width;
	int height;
	int version;
	int colors;
	uint8_t* buffer;
} tlg_t;

extern "C" {
tlg_t* new_tlg (tlg5_header_t * header);
void delete_tlg(tlg_t* tlg);
tlg_t* read_tlg(uint8_t *tlg_raw_data, int tlg_size);
tlg_t* read_tlg_file(const char* tlg_path);
}

#endif
